/**
 * Orion Security Browser
 * BugSec Team
 * @author Tiago Natel de Moura
 *
 * @license LGPL
 *
 * @link http://blog.tiagomoura-design.com.br
 * @link http://www.botecounix.com.br
 * @link http://orionsec.googlecode.com
 *
 * @class <class>
 * @version <version>
 * @since <version>
 */

#include "page.h"
#include <QPushButton>

PageWidget::PageWidget()
    : QWidget(0)
{

    createView();
    createToolBar();
}

PageWidget::~PageWidget()
{

}

void PageWidget::createView()
{
    view = new QWebView(this);
    view->setFixedSize(1024, 768);
    view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}

void PageWidget::createToolBar()
{
    toolbar = new QToolBar;
    urlEdit = new QLineEdit;
    submitUrlBtn = new QPushButton;
    submitUrlBtn->setIcon(QIcon(":/ui/icons/right_16.png"));
    submitUrlBtn->setStatusTip("Ir para esta url");

    urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());

    toolbar->addAction(view->pageAction(QWebPage::Back));
    toolbar->addAction(view->pageAction(QWebPage::Forward));
    toolbar->addAction(view->pageAction(QWebPage::Stop));
    toolbar->addAction(view->pageAction(QWebPage::Reload));
    toolbar->addWidget(urlEdit);
    toolbar->addWidget(submitUrlBtn);
}


